//
//  RW_LoginViewController.m
//  SleepApp
//
//  Created by MAC on 2021/3/29.
//  Copyright © 2021 RiceWang. All rights reserved.
//

#import "RW_LoginViewController.h"
#import "RW_LoginView.h"

@interface RW_LoginViewController ()

/** 视图类型 */
@property (nonatomic,assign) Login_View_Type view_type;
/** 展示内容 */
@property (nonatomic,strong) RW_LoginView *wlclass_login_view;
@end

@implementation RW_LoginViewController
+(void)pushAppleLoginFromVc:(UIViewController *)fromVc{
    RW_LoginViewController *vc = [[RW_LoginViewController alloc]init];
    vc.view_type = Login_View_Type_AppleLogin;
    [fromVc.navigationController pushViewController:vc animated:YES];
}
+(void)pushLoginFromVc:(UIViewController *)fromVc{
    RW_LoginViewController *vc = [[RW_LoginViewController alloc]init];
    vc.view_type = Login_View_Type_Login;
    [fromVc.navigationController pushViewController:vc animated:YES];
}
+(void)pushRegisterFromVc:(UIViewController *)fromVc{
    RW_LoginViewController *vc = [[RW_LoginViewController alloc]init];
    vc.view_type = Login_View_Type_Register;
    [fromVc.navigationController pushViewController:vc animated:YES];
}
- (void)initView{
    self.view.backgroundColor = HexColor(@"f6f6f6");

    [self.contentView addSubview:self.wlclass_login_view];
    [self.wlclass_login_view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsZero);
    }];
}
-(void)initData{
    [self.wlclass_login_view initData];
}

#pragma mark -- 父控制器功能
-(NSString *)set_title{
    if (self.view_type == Login_View_Type_Login){
        return @"登陆";
    } else if (self.view_type == Login_View_Type_Register){
        return @"注册";
    }
    return @"你进了入了了不起的地方";
}
#pragma mark -- 懒加载
-(RW_LoginView *)wlclass_login_view{
    if (!_wlclass_login_view){
        _wlclass_login_view = [[RW_LoginView alloc]init];
        _wlclass_login_view.wlclass_view_model.view_type = self.view_type;
    }
    return _wlclass_login_view;
}
@end
